home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / propdlg / propdlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  3.1 KB  |  127 lines

  1. // propdlg.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "propdlg.h"
  15.  
  16. #include "shapeobj.h"
  17. #include "colorpge.h"
  18. #include "stylepge.h"
  19. #include "propsht.h"
  20. #include "propsht2.h"
  21. #include "mainfrm.h"
  22. #include "shapedoc.h"
  23. #include "shapesvw.h"
  24.  
  25. #ifdef _DEBUG
  26. #undef THIS_FILE
  27. static char BASED_CODE THIS_FILE[] = __FILE__;
  28. #endif
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CPropDlgApp
  32.  
  33. BEGIN_MESSAGE_MAP(CPropDlgApp, CWinApp)
  34.     //{{AFX_MSG_MAP(CPropDlgApp)
  35.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  36.     //}}AFX_MSG_MAP
  37.     // Standard file based document commands
  38.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  39.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  40.     // Standard print setup command
  41. END_MESSAGE_MAP()
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CPropDlgApp object
  45.  
  46. CPropDlgApp theApp;
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CPropDlgApp initialization
  50.  
  51. BOOL CPropDlgApp::InitInstance()
  52. {
  53.     CSingleDocTemplate* pDocTemplate;
  54.     pDocTemplate = new CSingleDocTemplate(
  55.         IDR_MAINFRAME,
  56.         RUNTIME_CLASS(CShapesDoc),
  57.         RUNTIME_CLASS(CMainFrame),
  58.         RUNTIME_CLASS(CShapesView));
  59.     AddDocTemplate(pDocTemplate);
  60.  
  61.     OnFileNew();
  62.  
  63.     return TRUE;
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CAboutDlg dialog used for App About
  68.  
  69. class CAboutDlg : public CDialog
  70. {
  71. public:
  72.     CAboutDlg();
  73.  
  74. // Dialog Data
  75.     //{{AFX_DATA(CAboutDlg)
  76.     enum { IDD = IDD_ABOUTBOX };
  77.     //}}AFX_DATA
  78.  
  79. // Implementation
  80. protected:
  81.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  82.     //{{AFX_MSG(CAboutDlg)
  83.     virtual BOOL OnInitDialog();
  84.     //}}AFX_MSG
  85.     DECLARE_MESSAGE_MAP()
  86. };
  87.  
  88. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  89. {
  90.     //{{AFX_DATA_INIT(CAboutDlg)
  91.     //}}AFX_DATA_INIT
  92. }
  93.  
  94. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  95. {
  96.     CDialog::DoDataExchange(pDX);
  97.     //{{AFX_DATA_MAP(CAboutDlg)
  98.     //}}AFX_DATA_MAP
  99. }
  100.  
  101. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  102.     //{{AFX_MSG_MAP(CAboutDlg)
  103.         // No message handlers
  104.     //}}AFX_MSG_MAP
  105. END_MESSAGE_MAP()
  106.  
  107. /////////////////////////////////////////////////////////////////////////////
  108. // CAboutDlg message handlers
  109.  
  110. BOOL CAboutDlg::OnInitDialog() 
  111. {
  112.     CDialog::OnInitDialog();
  113.     CenterWindow();    
  114.     return TRUE;  // return TRUE unless you set the focus to a control
  115.                   // EXCEPTION: OCX Property Pages should return FALSE
  116. }
  117.  
  118. // App command to run the dialog
  119. void CPropDlgApp::OnAppAbout()
  120. {
  121.     CAboutDlg aboutDlg;
  122.     aboutDlg.DoModal();
  123. }
  124.  
  125. /////////////////////////////////////////////////////////////////////////////
  126. // CPropDlgApp commands
  127.